import requests
# 登录IHRM
resp = requests.post(url=" http://ihrm2-test.itheima.net/api/sys/login",
              json = {"mobile":"13800000002","password":"123456"})
token = resp.json().get("data")
# 提取登录令牌
# print(token)
# 添加员工
resp=requests.post(url="http://ihrm2-test.itheima.net/api/sys/user",
              headers={"Content-Type":"application/json",
                       "Authorization":token},
              json={
                  "username":"小傻瓜001",
                  "mobile":"13928551112",
                  "workNumber":"9588"
              })
print(resp.json())